package com.study.web.file;

import com.study.config.MinIoUtils;
import com.study.utils.SysUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author study
 * @version 1.0
 * @date 2020/8/25 22:49
 * minio 学习
 */
@Slf4j
@RestController
@RequestMapping("upfile")
@Api(tags = "minio上次文件")
public class MinioController {

    @Autowired
    MinIoUtils minIoUtils;

    @GetMapping()
    public String upFile() {

        String resourcePath = SysUtils.getResourcePath("pic/1.png");
        System.out.println(resourcePath);
        String upfile = minIoUtils.putObject("upfile", "阅读.png", resourcePath);
        return upfile;

    }
}

